{extend name="public:adminbase" /}

{block name="content"}


<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-header">
          <h4>昵称导入</h4>
        </div>
        <div class="card-toolbar clearfix">
          <div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
            <strong>注意事项：</strong>复制出来的文本，一行为一个昵称,可以有空行，如果导入失败，请检查特殊字符
          </div>

        </div>
        <div class="card-body">
          <textarea class="form-control" id="nicknames" name="nicknames" rows="12" placeholder="内容.."></textarea>
          <br><br><br>
          <button id="sub" class="btn btn-block btn-primary">确认导入</button>
        </div>
      </div>
    </div>
    
  </div>
  
</div>
{include file="public/afooter"}
<script>


$('#sub').click(function(){
  var url="{:url('AdminNickname/index')}";
  var data = {
      nicknames:$("#nicknames").val()
  }
  if($("#nicknames").val() == ''){
      error("请先输入内容");
      return false;
  }

  $.post(url,data,function (e) {
    if(e.code ==200){

        success(e.msg);
        $("#nicknames").val("");
    } else {
      error(e.msg);
    }
  })
})

</script>

{/block}